package com.tcs.util.spring;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

public class SpringAware implements ApplicationContextAware {

    private final Logger logger = LoggerFactory.getLogger(SpringAware.class);

    public SpringAware() {
        logger.info(" 初始化: springAware");
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        logger.info(" setApplicationContext: {} " , applicationContext);
        SpringConfigTool.setApplicationContext(applicationContext);
    }
}
